<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./index.js"></script>
</head>

<body>
    <button>点击</button>
    <script>
        const arr = [harryAjax({
            method: 'GET',
            url: 'http://ajax-base-api-t.itheima.net/api/getbooks'
            
        }), harryAjax({
            method: 'GET',
            url: 'http://ajax-base-api-t.itheima.net/api/getbooks',
        }),
        harryAjax({
            method: 'POST',
            url: 'http://ajax-base-api-t.itheima.net/api/addbook',
            data:{bookname:'白夜行',author:'东野圭吾',publisher:'上海出版社'}
        })]
        document.querySelector('button').addEventListener('click', function () {
            Promise.all(arr).then(res=>{
                document.write('我是界面')
               console.log(res);
            }).catch(err=>{
                document.write('404')
            })
        })
    </script>
</body>

</html>